﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Arizu.Repository;
using System.Data;
using System.Text;

namespace AiRiZu.User
{
    public partial class Calendar : Common
    {
        public string RoomListString { get; set; }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["logId"] == null)
            {
                return;
            }
            AirizuRoom airizuRoom = AirizuRoom.CreateInstance();

            DataTable dt = airizuRoom.GetRoomInfos(long.Parse(Session["logId"].ToString()));

            StringBuilder sBuilder = new StringBuilder();
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    sBuilder.Append("<a href=\"#none\" id=\"").Append(dt.Rows[i]["SendRoomid"].ToString()).Append("\" value=\"").Append(dt.Rows[i]["Name"].ToString()).Append("\" onclick=\"changeSelectedRoom(this.id, this.value);\">").Append(dt.Rows[i]["Name"].ToString()).Append("</a><p>");

                }
                RoomListString = sBuilder.ToString();
            }
        }
    }
}
